<{include file="common/header.tpl"}>
<{include file="common/navbar.tpl"}>
<div class="container" style="width: 100%;">
	<form action="/tool/saveInfo" name="form" method="post">
		<div class="row top-span-block">
			<div class="col-md-12">
				<label>ID：<{$data.id}></label>
			</div>
		</div>
		<div class="row">
			<div class="col-md-12">
				<label>标题：<{$data.title}></label>
			</div>
		</div>
		<div class="row">
			<div class="col-md-12">
				<label><a href="<{$data.url}>" target="_blank">链接</a></label>
			</div>
		</div>
		<div class="row inline-flex">
			<div class="col-md-12">
				<label>favicon：<img src="<{$data.icon}>" width="50" height="50"></label>
				<input type="button" name="favicon" value="使用">
			</div>
		</div>
		<div class="row inline-flex">
			<div class="col-md-12">
				<label>base64：<img src="<{$data.base64}>" width="50" height="50"></label>
				<input type="button" name="base64" value="使用">
			</div>
		</div>
		<div class="row clearfix top-span-block"></div>
		<div class="row">
			<div class="col-md-12">
				<label for="url">分类：<input type="text" name="cate" value="" width="100%"></label>
			</div>
		</div>
		<div class="row clearfix top-span-block"></div>
		<div class="row">
			<div class="col-md-12">
				<input type="hidden" name="id" value="<{$data.id}>" class="form-control">
				<label for="url">图标地址：<input type="text" name="url" value="" width="100%"></label>
			</div>
		</div>
		<div class="row clearfix top-span-block"></div>
		<div class="row">
			<div class="col-md-12">
				<input type="submit" name="submit" value="提交" class="btn">
			</div>
		</div>
	</form>
</div>
<{include file="common/admin_footer.tpl"}>
<script>
	$(function() {
		$("input[name=favicon]").on('click', useFavicon);
        $("input[name=base64]").on('click', useBase64);

		function useFavicon() {
            let favicon = '<{$data.icon}>';
            $("input[name=url]").val(favicon);
        }

        function useBase64() {
            let base64 = '<{$data.base64}>';
            $("input[name=url]").val(base64);
        }
    });
</script>
